import React from 'react';
import { HashRouter, Route, hashHistory } from 'react-router-dom'
import CacheRoute from 'react-router-cache-route';

//公用
import MyselfForm from '../pages/myselfForm.js'

//开发管理
import GetDocument from '../pages/dev/getDocument.js';
import Reference from '../pages/dev/reference.js';
import Print from '../pages/dev/print.js';
import Excel from '../pages/dev/excel.js';

//系统管理
import Menu from '../pages/sys/menu.js';
import Info from '../pages/sys/info.js';
import AddMenuForm from '../pages/sys/menu/addMenuForm.js';
import EditMenuForm from '../pages/sys/menu/editMenuForm.js';
import Role from '../pages/sys/role.js';
import AddRoleForm from '../pages/sys/role/addRoleForm.js';
import EditRoleForm from '../pages/sys/role/editRoleForm.js';
import OperationLog from '../pages/sys/operationLog.js';
import InsertUserByExcel from '../pages/user/insertUserByExcel.js';
import NoticeManagement from '../pages/sys/noticeManagement.js';
import AddNoticeForm from '../pages/sys/notice/addNoticeForm.js';

//用户管理
import InsertUser from '../pages/user/insertUser.js'
import UpdateOrSearch from '../pages/user/updateOrSearch.js'

//架构管理
import Framework from '../pages/framework/framework.js';
import Customer from '../pages/framework/customer.js';
import AddCustomer from '../pages/framework/customer/add.js';
import EditCustomer from '../pages/framework/customer/edit.js';
import Station from '../pages/framework/station.js';
import AddStation from '../pages/framework/station/add.js';
import EditStation from '../pages/framework/station/edit.js';
import Bom from '../pages/framework/bom.js';
import AddBom from '../pages/framework/bom/addBom.js';
import BomDetail from '../pages/framework/bom/bomDetail.js';
import AddBomByExcel from '../pages/framework/bom/addBomByExcel.js';

//销售管理
import UploadOrder from '../pages/sales/uploadOrder.js';
import SalesExcelForm from '../pages/sales/uploadOrder/salesExcelForm.js';
import SearchSales from '../pages/sales/searchSales.js';
import UpdateSales from '../pages/sales/updateSales.js';
import ShowSales from '../pages/sales/showSales.js'

//产品交付
import ProductDeliveryUploadOrder from '../pages/productDelivery/ProductDeliveryUploadOrder.js';
import ProductDeliveryExcelForm from '../pages/productDelivery/uploadOrder/productDeliveryExcelForm.js';
import SearchProductDelivery from '../pages/productDelivery/searchProductDelivery.js';
import UpdateProductDelivery from '../pages/productDelivery/updateProductDelivery.js';
import ShowProductDelivery from '../pages/productDelivery/showProductDelivery.js';

//售后服务
import AfterSalesUploadOrder from '../pages/afterSales/AfterSalesUploadOrder.js';
import AfterSalesExcelForm from '../pages/afterSales/uploadOrder/afterSalesExcelForm.js'
import SearchAfterSales from '../pages/afterSales/searchAfterSales.js'
import UpdateAfterSales from '../pages/afterSales/updateAfterSales.js';
import ShowAfterSales from '../pages/afterSales/showAfterSales.js';

//公共页
import Login from '../pages/login.js'
import Mainpage_new from '../pages/mainpage_new.js'
import Mainpage_show from '../pages/mainpage_show.js'

//报表
import Crkmx from '../components/ship/kc_report/crkmx.js';
import Sfc from '../components/ship/kc_report/sfc.js';
import Jskcmx from '../components/ship/kc_report/jskcmx.js';
import Scllhz from '../components/ship/kc_report/scllhz.js';
import Scllhz_print from '../components/ship/kc_report/scllhz_print.js';

import NotFound from '../components/notFound.js';
import Tinymce from '../components/ship/newmes/tinymce.js';

const Routecontainer = () => {
  return (
    <div style={{
      position: 'relative', Left: '0', Right: '0', margin: 'auto',
      width: '100%', height: '100%', fontFamily: "Microsoft YaHei", backgroundColor: "#F1F1F1"
    }}>
      <HashRouter history={hashHistory}>
        <div style={{ position: "relative", width: '100%', height: '100%' }}>
          {/*公用路由*/}
          <Route exact path="/" component={Login} />
          <Route path="/ship" component={Mainpage_new} />
          <Route path="/ship/myselfForm" component={MyselfForm} />

          {/*开发管理 */}
          <Route path="/ship/dev/getDocument" component={GetDocument}/>
          <Route path="/ship/dev/reference" component={Reference}/>
          <Route path="/ship/dev/print" component={Print}/>
          <Route path="/ship/dev/excel" component={Excel}/>

          {/*系统管理 */}
          <Route path="/ship/sys/menu" component={Menu}/>
          <Route path="/ship/sys/info" component={Info}/>
          <Route path="/ship/sys/role" component={Role}/>
          <Route path="/ship/sys/addMenuForm" component={AddMenuForm}/>
          <Route path="/ship/sys/editMenuForm" component={EditMenuForm}/>
          <Route path="/ship/sys/addRoleForm" component={AddRoleForm}/>
          <Route path="/ship/sys/editRoleForm" component={EditRoleForm}/>
          <Route path="/ship/sys/operationLog" component={OperationLog}/>
          <Route path="/ship/sys/noticeManagement" component={NoticeManagement}/>
          <Route path="/ship/sys/addNoticeForm" component={AddNoticeForm}/>

          {/**功能路由 */}
          <Route path="/ship/sys/insertUserByExcel" component={InsertUserByExcel}/>

          {/**用户管理 */}
          <Route path="/ship/user/insertUser" component={InsertUser}/>
          <Route path="/ship/user/updateOrSearch" component={UpdateOrSearch}/>

          {/*架构管理 */}
          <Route path="/ship/framework/framework" component={Framework}/>
          <Route path="/ship/framework/customer" component={Customer}/>
          <Route path="/ship/framework/customer/add" component={AddCustomer}/>
          <Route path="/ship/framework/customer/edit" component={EditCustomer}/>
          <Route path="/ship/framework/station" component={Station}/>
          <Route path="/ship/framework/station/add" component={AddStation}/>
          <Route path="/ship/framework/station/edit" component={EditStation}/>
          <Route path="/ship/framework/bom" component={Bom}/>
          <Route path="/ship/framework/bom/addBom" component={AddBom}/>
          <Route path="/ship/framework/bom/bomDetail" component={BomDetail}/>
          <Route path="/ship/framework/bom/addBomByExcel" component={AddBomByExcel}/>

          {/*销售管理 */}
          <Route path="/ship/sales/uploadOrder" component={UploadOrder}/>
          <Route path="/ship/sales/salesExcelForm" component={SalesExcelForm}/>
          <Route path="/ship/sales/searchSales" component={SearchSales}/>
          <Route path="/ship/sales/updateSales" component={UpdateSales}/>
          <Route path="/ship/sales/showSales" component={ShowSales}/>

          {/*产品交付 */}
          <Route path="/ship/productDelivery/productDeliveryUploadOrder" component={ProductDeliveryUploadOrder}/>
          <Route path="/ship/productDelivery/productDeliveryExcelForm" component={ProductDeliveryExcelForm}/>
          <Route path="/ship/productDelivery/searchProductDelivery" component={SearchProductDelivery}/>
          <Route path="/ship/productDelivery/updateProductDelivery" component={UpdateProductDelivery}/>
          <Route path="/ship/productDelivery/showProductDelivery" component={ShowProductDelivery}/>

          {/*售后服务 */}
          <Route path="/ship/afterSales/afterSalesUploadOrder" component={AfterSalesUploadOrder}/>
          <Route path="/ship/afterSales/afterSalesExcelForm" component={AfterSalesExcelForm}/>
          <Route path="/ship/afterSales/searchAfterSales" component={SearchAfterSales}/>
          <Route path="/ship/afterSales/updateAfterSales" component={UpdateAfterSales}/>
          <Route path="/ship/afterSales/showAfterSales" component={ShowAfterSales}/>

          {/* 404 Route */}
          <Route path="/ship/404" component={NotFound} />
          <Route path="/ship/mainpage" component={Mainpage_show} />
          <Route path="/ship/tinymce" component={Tinymce} />

          {/*报表*/}
          <CacheRoute path="/shipSRM/report/crkmx" component={Crkmx}
            cacheKey="crkmx" />
          <CacheRoute path="/shipSRM/report/jskcmx" component={Jskcmx}
            cacheKey="jskcmx" />
          <CacheRoute path="/shipSRM/report/sfc" component={Sfc}
            cacheKey="sfc" />
          <CacheRoute path="/shipSRM/report/scllhz" component={Scllhz}
            cacheKey="scllhz" />
          <Route path="/shipSRM_one/report/scllhz_print" component={Scllhz_print}
          />
        </div>
      </HashRouter>
    </div>
  );

}

export default Routecontainer